package com.ruoyi.business.payment.vo;


import com.ruoyi.business.approvalflow.vo.TRegisterApprovalFlowVo;
import com.ruoyi.business.domain.TRegisterInfo;
import com.ruoyi.business.domain.TRegisterNotice;
import com.ruoyi.business.payment.domain.TRegisterPaymentOrder;
import lombok.*;
import lombok.experimental.Accessors;
import org.apache.commons.lang3.time.DateUtils;

import java.util.Date;

/**
 * 预支付订单信息Vo对象 t_register_payment_order
 *
 * @author Tellsea
 * @date 2025-06-22
 */
@Data
@Accessors(chain = true)
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
public class TRegisterPaymentOrderDto extends TRegisterPaymentOrder {

    /**
     * 报名信息
     */
    private TRegisterInfo registerInfo;

    /**
     * 通知信息
     */
    private TRegisterNotice registerNotice;

    /**
     * 审批流程信息
     */
    private TRegisterApprovalFlowVo registerApprovalFlow;


    /**
     * 是否有审批权限
     */
    private boolean ifCanApprove=false;

    /**
     * 关闭订单时间
     */
    @Getter(AccessLevel.NONE)
    private Date closeOrderTime;

    public Date getCloseOrderTime() {
        if(this.getCreateTime()!=null){
            this.closeOrderTime = DateUtils.addDays(this.getCreateTime(),30);
        }
        return closeOrderTime;
    }
}
